<template>
	<view style="padding: 30rpx;">
		<button @click="callSetStorage()">setStorage</button>
		<button @click="callGetStoreage()">获取存储</button>
		<button @click="callStoInfo()"type="primary">获取字段列表</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			callSetStorage(){
				console.log("callSetStorage-->userName chenyuanzhu");
				uni.setStorage({
					key:"userName",
					data:"huyajun",
					success(){
						console.log("存储userName 成功回调");
					},
					fail(){
						console.error("存储userName 成功失败");
					}
				})
			},
			callGetStorage(){
				uni.getStorage({
					key:"Account",
					success:function(result){
						console.log("获取本地缓存成功 result.data:"+result.data);
					},
					fail(){
						console.error("获取本地缓存失败:"+JSON.stringify(result));
						console.erroe("获取本地缓存失败:"+result.errMsg);
					}
				})
			},
			callStoInfo(){
				console.log("callStoInfo-->");
				uni.getStorage({
					success:function(result){
						console.log("callStoInfo-->"+JSON.stringify(result));
					}
				})
			}
		}
	}
</script>

<style>
	button{
		margin: 30rpx;
	}

</style>
